#ifndef     __HANDLER_TASK_H
#define     __HANDLER_TASK_H

#include "../rtos/thread.h"
#include "../rtos/message_queue.h"
#include "../conn/message.h"
#include "../utils/object.h"

namespace task {

class HandlerTask : public rtos::Thread<HandlerTask, 2048, osPriorityHigh3> {

public:
    inline void post(const conn::Message &msg) {
        m_mq.post(msg);
    }

    void run();

private:
    rtos::MessageQueue<conn::Message, 10> m_mq;
};

inline utils::Object<HandlerTask> handlerTask;

}

#endif
